#include <bits/stdc++.h>

using namespace std;
int a, m;

int main()
{
	cin >> a >> m;
	if (a % m == 0)
	{
		cout << "Yes";
		return 0;
	}
	for (int i = 1; i <= 10000; i++)
	{
		a += a % m;
		if (a % m == 0)
		{
			cout << "Yes";
			return 0;
		}
	}

	cout << "No"
		 << "\n";

	return 0;
}